package sctu.edu.java.year2016.team01.xuhanmei.day20160529.KnowDuoTai;

/**
 * Created by Administrator on 2016/5/29.
 */
public class CarFactory {

    public static Car getCar(String name) {

        if (name.equalsIgnoreCase("BMW")) {
            return new BMW();
        } else if (name.equalsIgnoreCase("Benz")) {
            return new Benz();
        } else {
            return null;
        }
    }
}
